#include<stdio.h>
#include<string.h>
int main()
{
	char a[1000];
	int i=0,m=1;
    gets(a);
	while(a[i]!='\0')
	{
	 if ((a[i]>= 'A' &&a[i]<= 'Z' )||(a[i]>= 'a' &&a[i]<= 'z' )||(a[i]>= '0' &&a[i]<= '9' ))
	 {
	 	printf("%c",a[i]);
	 	m=1;
	 }	
	 else if(m==1)
	 {
	 	printf("\n");
	 	m=0;
	 }
	 i++;
	}
	return 0;
}
